package com.ssy.lingxi.contract.repository;


import com.ssy.lingxi.contract.entity.ContractTemplate;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Optional;

/**
 * 物流公司实体仓库
 *
 * @author yzc
 * @version 2.0.0
 * @date 2020/8/20
 */
public interface ContractTemplateRepository extends JpaRepository<ContractTemplate, Long>, JpaSpecificationExecutor<ContractTemplate> {

    Page<ContractTemplate> findAllByMemberId(Long memberId, Pageable page);

    List<ContractTemplate> findAllByMemberIdAndState(Long memberId, Integer state, Sort sort);

    Optional<ContractTemplate> findByIdAndMemberId(Long id, Long memberId);
}